<#assign path = request.getContextPath() />
<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>批量导入</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="${path}/static/css/font.css">
        <link rel="stylesheet" href="${path}/static/css/css.css">
		<link rel="stylesheet" type="text/css" href="${path}/static/css/xadmin.css"/>
		<script src="${path}/static/js/jquery.min.js"></script>
        <script type="text/javascript" src="${path}/static/lib/layui/layui.js"></script>
        <script type="text/javascript" src="${path}/static/js/xadmin.js"></script>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
				<div id="btns" class="btns">
					<button type="button" class="layui-btn" id="uploadExcel" name="file">
                        <i class="layui-icon">&#xe67c;</i>导入
                    </button>
					<button type="button" class="btn-w" onclick="downloadTemplate()">下载导入模板</button>
				</div>
               
                <#--<textarea class="border">-->
                	<#--批量导入员工信息，请下载导入模版！-->
                <#--</textarea>-->
            </div>
        </div>
    </body>
 <script>
     //上传
     layui.use(['element','upload'], function () {
         var $ = layui.jquery,
                 element=layui.element,
                 upload=layui.upload;
         //执行实例
         upload.render({
             elem: '#uploadExcel',
             url: '/api/employee/import/infos',
             multiple: true,
             accept: 'file',
             exts: 'xls|xlsx',
             before: function (obj) {
                 layer.load();
             },
             done: function (res) {
                 layer.closeAll('loading');
                 console.log(res);
                 if (res.status == 200) {
                     layer.msg("上传成功", {
                                 icon: 6
                             },
                             function () {
                                 //关闭当前frame
                                 xadmin.close();
                                 // 可以对父窗口进行刷新
                                 xadmin.father_reload();
                             });
                 }

             }
             , error: function () {
                 layer.closeAll('loading');
             }
         });
     });
     // 下载模板
    function downloadTemplate() {
        window.open("/api/employee/info/download/template", "_self");
    }
 </script>
</html>
